package com.ai.ly.goodsautocat.util;

import com.ai.ly.goodsautocat.common.wordfilter.DefaultWordFilter;
import com.ai.ly.goodsautocat.common.wordfilter.MiddleWordFilter;
import com.ai.ly.goodsautocat.common.wordfilter.IWordFilter;
import com.ai.ly.goodsautocat.common.wordfilter.SimpleWordFilter;

public class WordFilterFactory {
    
    public static IWordFilter defaultFilter=new DefaultWordFilter();
    
    public static IWordFilter middleWordFilter=new MiddleWordFilter();
    
    /**只过滤空字符串*/
    public static IWordFilter simpleWordFilter=new SimpleWordFilter();
    
    /**
     * 是否要过滤
     * @return
     * @author liangyi
     */
    public static boolean shouldFilterWord(String word) {
        boolean result=middleWordFilter.shouldFilterWord(word);
        return result;
    }
    
    /**
     * 是否要过滤
     * @return
     * @author liangyi
     */
    public static boolean shouldFilterWord(String word,IWordFilter filter) {
        boolean result=filter.shouldFilterWord(word);
        return result;
    }
    
}
